﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Templates_SystemHolder_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

    <acms:JavascriptFile ID="jquery" Path="~/Scripts/swfobject.js" runat="server" />

    <script type="text/javascript">
    var jsReady = false;

    function isReady() {
        return jsReady;
    }

    function pageInit() {
        jsReady = true;
        //alert("js ready");
        //document.forms["form1"].output.value += "\n" + "JavaScript is readyy.\n";
    }

    function thisMovie(movieName) {
        if (window.document[movieName]) {
            return window.document[movieName];
        }
        if (navigator.appName.indexOf("Microsoft Internet") == -1) {
            if (document.embeds && document.embeds[movieName])
                return document.embeds[movieName];
        }
        else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
        {
            return document.getElementById(movieName);
        }
    }

    function sendToActionScriptA(pos) {
        
        if (hasFlash == true) {
            thisMovie("Systems").sendToActionScript(pos);
        } else { sendToJavaScript(pos) }
    }

    function sendToJavaScript(value) {
        //alert(value);
        showItem(value);
       
        //document.forms["form1"].output.value += "ActionScript says: " + value + "\n";
    }
    // execute your scripts when the DOM is ready. this is mostly a good habit

    $(function() {
        pageInit();

        //SELECT FIRST LI AS ACTIVE
        $('#navApplications li:first').addClass("active");
        $('#navPage li:first').addClass("active");



        //Attach Tabs
        $("ul.flowtabs").tabs(".flowpanes > div");
        $("ul.flowtabs").each(
            function(intIndex) {
                x = $("a" + intIndex);
                x = $(this).data("tabs");
                //console.log(x);
                //alert(x);
                x.onClick(function(index) {
                    initjScrollPane();
                });
            }
        )
        $("ul.allflowtabs").tabs(".allflowpanes > div.allflowpane");
        var apiallflowtabs = $("ul.allflowtabs").data("tabs");
        apiallflowtabs.onClick(function(index) {
            initjScrollPane();
        });

        //Attach Scrollale in Tabs


        //        var $scrollables = $(".scrollable").scrollable({ vertical: true, mousewheel: true, circular: true});

        //        $scrollables.each(function() {
        //            var $itemsToClone = $(this).scrollable().getItems().slice(1);
        //            var $wrap = $(this).scrollable().getItemWrap();
        //            var clonedClass = $(this).scrollable().getConf().clonedClass;
        //            $itemsToClone.each(function() {
        //                $(this).clone(true).appendTo($wrap)
        //			.addClass(clonedClass + ' hacked-' + clonedClass);
        //            })
        //        })

        //var scrollableApi = $(".scrollable").data("scrollable");


        //
        //        $(".hotSpot").tooltip({
        //            position: 'bottom left',
        //            //position: 'bottom right',
        //            relative: true,
        //            offset: [-60, 10],
        //            effect: 'slide'
        //        });

        $(".hotSpot").each(function() {
            var hotspot = parseInt($(this).css('top'), 10);
            if (hotspot > 150) {
                //alert("yes");

                $(this).tooltip({
                    position: 'top left',
                    //position: 'bottom right',
                    relative: true,
                    offset: [95, 10],
                    effect: 'slide'
                })

            } else {
                $(this).tooltip({
                    position: 'bottom left',
                    //position: 'bottom right',
                    relative: true,
                    offset: [-60, 10],
                    effect: 'slide'
                })
            }
        })

        $("a.lnkNavPage").bind("click", function() {
            if ($(this).parent().hasClass("active")) {
                return false;
            }
            else {
                pos = $(this).parent().index();
                $(".items .active").fadeOut('fast', function() {

                    if (hasFlash == true) {
                        sendToActionScriptA(pos);
                    } else { sendToJavaScript(pos) }

                }).removeClass("active");

                $("a.lnkNavPage").parent().removeClass("active");
                $(this).parent().addClass("active");
            }
            return false
        });

        //test start
        $("a#Test").bind("click", function() {
            //alert("start");
            $("#TestBlock").fadeOut('fast', function() { alert("now"); });
            return false
        });
        //test end

        initTabScrollable()
    });

    function showItem(itemNo) {
        $('.items .item:eq(' + itemNo + ')').fadeIn('fast').addClass("active");
    }
</script>
    
    <!--SWF OBJECT-->
    <script type="text/javascript">
    var hasFlash = false;
    var flashvars = {};
    var params = {
        menu: "false",
        scale: "noScale",
        allowFullscreen: "true",
        allowScriptAccess: "always",
        bgcolor: "#FFFFFF",
        wmode:"transparent"
    };
    var attributes = {
        id: "Systems"
    };
    swfobject.embedSWF("<%= GetFlash() %>", "Systems", "100%", "100%", "9.0.0", "../../Flash/expressInstall.swf", flashvars, params, attributes, outputStatus);

    function outputStatus(e) {
        if (e.success == true) {
            hasFlash = true;
            //alert("success"+e.success)
        } else {
        //"fail"+e.success 
        }
        
    }

    
    
</script>
    
</asp:Content>
    
<asp:Content ID="Content2" ContentPlaceHolderID="contentTop" Runat="Server">
    
    <div id="top" style="position:relative" class="systemHolder">
        <div id="navPageContainer">
            <ul id="navPage" class="allflowtabs clearfix">
                <acms:SimpleRepeater ID="dlPageChildren" DataSourceID="dsChildren" AllowPaging="false" runat="server">
                        <ItemTemplate>
                            <li runat="server" id="navLi" >
                                <asp:HyperLink ID="lnkNavChildren" CssClass="lnkNavPage" NavigateUrl="#" runat="server" />
                            </li>
                        </ItemTemplate>
                    </acms:SimpleRepeater>
            </ul>
        </div>
            
        <div class="systemFlashPanels" style="position:relative">
            
            <div class="items">
                <acms:SimpleRepeater ID="dlFeed" DataSourceID="dsChildren" AllowPaging="false" runat="server">
                    <ItemTemplate>
                        <asp:Panel ID="pnlItem" runat="server" CssClass="item ">
                            <asp:PlaceHolder ID="phPopup1" runat="server">
                                <asp:HyperLink ID="lnk1" CssClass="hotSpot" runat="server" />
                                <div class="tooltip">
                                    <h3><acms:TextContentControlDisplay ID="acmsTitle1" ControlName="Pop1_Title" runat="server" /></h3>
                                    <acms:HtmlContentControlDisplay ID="acmsCopy1" ControlName="Pop1_Copy" CssClass="wrapper" runat="server" />
                                </div>
                            </asp:PlaceHolder>
                            <asp:PlaceHolder ID="phPopup2" runat="server">
                                <asp:HyperLink ID="lnk2" CssClass="hotSpot" runat="server" />
                                <div class="tooltip">
                                    <h3><acms:TextContentControlDisplay ID="acmsTitle2" ControlName="Pop2_Title" runat="server" /></h3>
                                    <acms:HtmlContentControlDisplay ID="acmsCopy2" ControlName="Pop2_Copy" CssClass="wrapper" runat="server" />
                                </div>
                            </asp:PlaceHolder>
                            <asp:PlaceHolder ID="phPopup3" runat="server">
                                <asp:HyperLink ID="lnk3" CssClass="hotSpot" runat="server" />
                                <div class="tooltip">
                                    <h3><acms:TextContentControlDisplay ID="acmsTitle3" ControlName="Pop3_Title" runat="server" /></h3>
                                    <acms:HtmlContentControlDisplay ID="acmsCopy3" ControlName="Pop3_Copy" CssClass="wrapper" runat="server" />
                                </div>
                            </asp:PlaceHolder>
                            <asp:PlaceHolder ID="phPopup4" runat="server">
	                            <asp:HyperLink ID="lnk4" CssClass="hotSpot" runat="server" />
		                        <div class="tooltip">
			                        <h3><acms:TextContentControlDisplay ID="acmsTitle4" ControlName="Pop4_Title" runat="server" /></h3>
	                                <acms:HtmlContentControlDisplay ID="acmsCopy4" ControlName="Pop4_Copy" CssClass="wrapper" runat="server" />
		                        </div>
                            </asp:PlaceHolder>
                            <asp:PlaceHolder ID="phPopup5" runat="server">
	                            <asp:HyperLink ID="lnk5" CssClass="hotSpot" runat="server" />
		                        <div class="tooltip">
			                        <h3><acms:TextContentControlDisplay ID="acmsTitle5" ControlName="Pop5_Title" runat="server" /></h3>
	                                <acms:HtmlContentControlDisplay ID="acmsCopy5" ControlName="Pop5_Copy" CssClass="wrapper" runat="server" />
		                        </div>
                            </asp:PlaceHolder>
                            
                        </asp:Panel>
                    </ItemTemplate>
                </acms:SimpleRepeater>
            </div>
            <acms:PostDataSource ID="dsChildren" runat="server" />
        
            <%--        <div class="items" style="">
            <div class="item active systemsSpecification">
                <a class="hotSpot" style="left:435px; top:125px; ">More Info</a>
                <div class="tooltip">
                    <h3><span>System One</span></h3>
                    <p>The quick brown fox.</p>
                </div>
                <a class="hotSpot" style="left:495px; top:190px; ">More Info</a>
                <div class="tooltip">
                    <h3><span>System Two</span></h3>
                    <p>Jumped over the lazy dog.</p>
                </div>
            </div>
            <div class="item systemsApplication" style="display:none">
                <a class="hotSpot" style="left:470px; top:235px; ">More Info</a>
                <div class="tooltip">
                    <h3><span>Application One</span></h3>
                    <p>The quick brown fox.</p>
                </div>
            </div>
            <div class="item systemsGroundStation" style="display:none">
                <a class="hotSpot" style="left:695px; top:70px; ">More Info</a>
                <div class="tooltip">
                    <h3><span>Ground Station</span></h3>
                    <p>Where are all the good times?</p>
                </div>
            </div>
        </div>
--%>
            
            <div id="flashContainer" style="">  
                <div id="Systems">
                    <p>Systems</p>
                    <p>Alternative content</p>
                    <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
	            </div>
            </div>
            
        </div>
        <%--<a class="prev browse left">---</a><a class="next browse right">|||</a>--%>

        
        
        <div id="subNav" style="" class="clearfix">

            <ul id="navApplications" class="">
               
               <asp:PlaceHolder ID="phParentNav" runat="server">
                    <acms:SimpleRepeater ID="dlNavParent" DataSourceID="dsParent" AllowPaging="false" runat="server">
                        <ItemTemplate>
                            <li runat="server" id="navLi" class="parent" >
                                <asp:HyperLink ID="lnkNav" CssClass="navApplication" NavigateUrl="#" runat="server" />
                            </li>
                        </ItemTemplate>
                    </acms:SimpleRepeater>
                    
                </asp:PlaceHolder>
            </ul>
            
            
            
            <ul id="navDetails">
                <acms:SimpleRepeater ID="dlNavSiblings" DataSourceID="dsSibling" AllowPaging="false" runat="server">
                    <ItemTemplate>
                        <li runat="server" id="navLi" >
                            <asp:HyperLink ID="lnkNavSibling" CssClass="" NavigateUrl="#" runat="server" />
                        </li>
                    </ItemTemplate>
                </acms:SimpleRepeater>
                
                <acms:PostDataSource ID="dsSibling" runat="server" />
                <acms:PostDataSource ID="dsParent" runat="server" />
                
                <%--<li><acms:PostLink ID="PostLink2" Path="~/Press-Area/Videos" runat="server" Text="Videos" /></li>--%>
                <%--<li><acms:PostLink ID="PostLink3" Path="~/Contact/Support" runat="server" Text="Support" /></li>--%>
                <li><acms:PostLink ID="PostLink1" Path="~/Download/Brochures" runat="server" Text="Brochures" /></li>
            </ul>
        
        </div>
        
        <div id="pageTitle" class="clearfix">
            <h1><acms:PostDisplayName ID="PostDisplayName" runat="server" /></h1>
            <asp:HyperLink NavigateUrl="#" id="lnkMoreInfo" runat="server" href="#" class="moreInfo moreInfoOpen off" Text="More Info"/>
            
        </div>
    
    </div>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="ContentBase" Runat="Server">

    <div id="base" class="clearfix">
    
        <div class="allflowpanes clearfix">
            <acms:SimpleRepeater ID="rptTabs" DataSourceID="dsTabs" runat="server">
               
                <ItemTemplate>
                
                    <acms:SubTemplateLoader ID="tabs" TemplateFileName="Display" runat="server" />
                </ItemTemplate>
            </acms:SimpleRepeater>
            <acms:PostDataSource ID="dsTabs" runat="server" />
        </div>
        
        <a href="#" style="" class="moreInfo moreInfoClose open">Close</a>
    
    </div>
    
</asp:Content>